using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class videoMap : EntityTypeConfiguration<video>
    {
        public videoMap()
        {
            // Primary Key
            this.HasKey(t => t.VCID);

            // Properties
            this.Property(t => t.imagefile)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(12);

            this.Property(t => t.title)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(14);

            this.Property(t => t.note)
                .IsRequired();

            this.Property(t => t.simagefile)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(12);

            // Table & Column Mappings
            this.ToTable("video");
            this.Property(t => t.VCID).HasColumnName("VCID");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.imagefile).HasColumnName("imagefile");
            this.Property(t => t.title).HasColumnName("title");
            this.Property(t => t.note).HasColumnName("note");
            this.Property(t => t.simagefile).HasColumnName("simagefile");
            this.Property(t => t.imagetype).HasColumnName("imagetype");
            this.Property(t => t.Picture).HasColumnName("Picture");
            this.Property(t => t.sPicture).HasColumnName("sPicture");
        }
    }
}
